<include target="header.html" />
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/comment/tpl/declared_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="deleteChecked" id="fo_list" action="./" method="post">
	<input type="hidden" name="module" value="comment" />
	<input type="hidden" name="act" value="procCommentAdminDeleteChecked" />
	<input type="hidden" value="{getUrl('', 'module', $module, 'act', $act)}" name="success_return_url">
	<input type="hidden" name="page" value="{$page}" />
	<input type="hidden" name="is_trash" value="false" />
	<input type="hidden" name="xe_validator_id" value="modules/comment/tpl/declared_list/1" />
	
	<!-- 목록 -->
	<table id="commentListTable" class="x_table x_table-striped x_table-hover">
		<caption>
			<a href="{getUrl('search_keyword','','search_target','','act','dispCommentAdminList','Y')}">{$lang->all}</a>
			<i>|</i>
			<a href="{getUrl('act','dispCommentAdminList','search_target','is_secret','search_keyword','N')}">{$secret_name_list['N']}</a>
			<i>|</i>
			<a href="{getUrl('act','dispCommentAdminList','search_target','is_secret','search_keyword','Y')}">{$secret_name_list['Y']}</a>
			<i>|</i>
			<a href="{getUrl('act','dispCommentAdminList','search_target','is_published','search_keyword','N')}">{$lang->published_name_list['N']}</a>
			<i>|</i>
			<a href="{getUrl('act','dispCommentAdminList','search_target','is_published','search_keyword','Y')}">{$lang->published_name_list['Y']}</a>
			<i>|</i>
			<a href="{getUrl('', 'module', 'admin', 'act','dispCommentAdminDeclared')}" class="active"|cond="$act == 'dispCommentAdminDeclared'">{$lang->cmd_declared_list}({number_format($total_count)})</a>

			<div class="x_pull-right x_btn-group">
				<button class="x_btn" type="submit" name="trash" onclick="this.form.is_trash.value=true">{$lang->cmd_trash}</button>
				<button class="x_btn" type="submit" onclick="this.form.is_trash.value=false">{$lang->cmd_delete_checked_comment}</button>
			</div>
		</caption>
		<thead>
			<tr>
				<th scope="col">{$lang->comment}</th>
				<th scope="col">{$lang->user_name}</th>
				<th scope="col">{$lang->date}</th>
				<th scope="col">{$lang->cmd_declare}</th>
				<th scope="col">{$lang->ipaddress}</th>
				<th scope="col" style="width:15px"><input type="checkbox" /></th>
			</tr>
		</thead>
		<tbody>
			<tr loop="$comment_list => $no, $oComment">
				<td><a href="{getUrl('','document_srl',$oComment->get('document_srl'))}#comment_{$oComment->get('comment_srl')}" onclick="window.open(this.href);return false;">{$oComment->getSummary(100)}</a></td>
				<td><span class="member_{$oComment->getMemberSrl()}">{$oComment->getNickName()}</span></td>
				<td>{$oComment->getRegdate("Y-m-d")}</td>
				<td><strong>{$oComment->get('declared_count')}</strong></td>
				<td>{$oComment->get('ipaddress')}</td>
				<td><input type="checkbox" name="cart[]" value="{$oComment->get('comment_srl')}" /></td>
			</tr>
			<tr cond="!$comment_list">
				<td>{$lang->no_documents}</td>
			</tr>
		</tbody>
	</table>
	<div class="x_clearfix">
		<div class="x_pull-left x_btn-group">
			<button class="x_btn" type="button" onclick="doCancelDeclare();">{$lang->cmd_cancel_declare}</button>
		</div>
		<div class="x_pull-right x_btn-group">
			<button class="x_btn" type="submit" name="trash" onclick="this.form.is_trash.value=true">{$lang->cmd_trash}</button>
			<button class="x_btn" type="submit" onclick="this.form.is_trash.value=false">{$lang->cmd_delete_checked_comment}</button>
		</div>
	</div>
</form>

<form action="./" class="x_pagination x_pagination-centered">
	<input type="hidden" name="error_return_url" value="" />
	<input type="hidden" name="module" value="{$module}" />
	<input type="hidden" name="act" value="{$act}" />
  	<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
  	<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
	<ul>
		<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">&laquo; {$lang->first_page}</a></li>
		<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
		{@$isGoTo = true}
		<li>
			<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">&hellip;</a>
			<span cond="$isGoTo" id="goTo" class="x_input-append">
				<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
				<button type="submit" class="x_add-on">Go</button>
			</span>
		</li>
		</block>

		<!--@while($page_no = $page_navigation->getNextPage())-->
		{@$last_page = $page_no}
		<li class="x_active"|cond="$page_no == $page"><a  href="{getUrl('page', $page_no)}">{$page_no}</a></li>
		<!--@end-->

		<block cond="$last_page != $page_navigation->last_page && $last_page + 1 != $page_navigation->last_page">
		{@$isGoTo = true}
		<li>
			<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">&hellip;</a>
			<span cond="$isGoTo" id="goTo" class="x_input-append">
				<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
				<button type="submit" class="x_add-on">Go</button>
			</span>
		</li>
		</block>
		<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} &raquo;</a></li>
	</ul>
</form>
<script>
jQuery(function($){
	// Modal anchor activation
	var $docTable = $('#commentListTable');
	$docTable.find(':checkbox').change(function(){
		var $btn = $('#fo_list [type="submit"], #fo_list [type="button"]');
		if($docTable.find('tbody :checked').length == 0){
			$btn.addClass('x_disabled');
		} else {
			$btn.removeClass('x_disabled');
		}
	}).change();
});
</script>